<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::any('wechat',   'WechatController@serve');
Route::prefix('zadmin')->namespace('Admin')->group(function(){
	Route::get('login',     'LoginController@login');
 	Route::any('logindo',   'LoginController@loginDo');
 	Route::get('logout',	'LoginController@logout');
 	Route::middleware('checkAdmin')->group(function(){
		Route::resource('admins',	'AdminController');				
		
		Route::resource('role',		 'RoleController');
		Route::get('points/copy','PointController@copy');
		Route::resource('points',	 'PointController');
		Route::resource('routes',	 'RouteController');
		Route::resource('users',	 'UserController');
		Route::resource('orders',	 'OrderController');
		Route::resource('types',	  'TypeController');
		
	
		Route::get('index',			'IndexController@index');
		Route::get('test',			'IndexController@test');
		Route::resource('menu',		'MenuController');
		Route::get('menu/permission/{id}','MenuController@menuPermission');
		Route::resource('permission',	  'PermissionController');
		

		Route::get('/','IndexController@dashboard');
	});
	

});



Route::get('/',    		'IndexController@index');
Route::get('reg',  		'IndexController@reg');
Route::post('reg-save', 'IndexController@regSave');
Route::get('login',		'IndexController@login');
Route::get('logout',		'IndexController@logout');
Route::post('login-do', 'IndexController@loginDo');
Route::post('book',     'IndexController@book');
Route::get('car-info',  	'CarController@show');

Route::any('order-create',   'OrderController@create');
Route::get('order-cancel',   'OrderController@cancel');
Route::get('order-complete', 'OrderController@complete');
Route::get('order-pickup',   'OrderController@pickup');
Route::get('order-show',     'OrderController@show');
Route::get('order-pay',      'OrderController@pay');
Route::any('mybooking',      'OrderController@mybooking')->name('mybooking');
Route::get('get-cars',       'CarController@getCars');

Route::get('payment-status',array('as'=>'payment.status','uses'=>'PaymentController@paymentInfo'));



Route::get('payment-cancel', function () {

   return 'Payment has been canceled';

});

Route::get('auto-close','IndexController@autoClose');






